package io.qar.setmeals.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.qar.commons.mybatis.service.impl.CrudServiceImpl;
import io.qar.setmeals.dao.SetmealsDao;
import io.qar.setmeals.dto.SetmealsDTO;
import io.qar.setmeals.entity.SetmealsEntity;
import io.qar.setmeals.service.SetmealsService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 套餐信息表
 *
 * @author yyyyjinying 1020066395@qq.com
 * @since 3.0 2024-06-10
 */
@Service
public class SetmealsServiceImpl extends CrudServiceImpl<SetmealsDao, SetmealsEntity, SetmealsDTO> implements SetmealsService {

    @Override
    public QueryWrapper<SetmealsEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<SetmealsEntity> wrapper = new QueryWrapper<>();

        String name = (String)params.get("name");
        wrapper.eq(StringUtils.isNotBlank(name), "name", name);

        return wrapper;
    }


}